<script lang="ts" setup>
import { useFaceApi } from '@/hooks/useFaceApi'

const { container, stop, start } = useFaceApi(400, 400)
onUnmounted(() => {
  handleEnd()
})
function handleStart() {
  start()
}
function handleEnd() {
  // video.value && video.value.videoElement.srcObject!.getTracks()[0].stop()
  stop()
}
</script>

<template>
  <div>
    <el-button type="primary" size="default" @click="handleStart">开始</el-button>
    <el-button type="primary" size="default" @click="handleEnd">关闭</el-button>
    <div ref="container" style="position: relative"></div>
  </div>
</template>

<style scoped lang="less"></style>
